﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
Inherits="MOWebApplication.Default"
 MasterPageFile="~/MOWebApplication.Master"
 %>

<asp:Content ID="mainContentId"  ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>
    
    <script type="text/javascript">

        function mousedown(obj, event) {

            document.getElementById('ctl00_ContentPlaceHolder1_hidMouseX').value = event.clientX - obj.offsetLeft;

            document.getElementById('ctl00_ContentPlaceHolder1_hidMouseY').value = event.clientY - obj.offsetTop;

            PageMethods.Dummy(event.clientX - obj.offsetLeft, 
            event.clientY - obj.offsetTop, 
             document.getElementById('ctl00_hdnSelectedTool').value,
             Dummy_Success
             //document.getElementById('ctl00_ContentPlaceHolder1_imgProduct') 
             );
            //window.location.reload(false);

            //location.reload(2);//Same effect as above

        }
         function Dummy_Success(result) {

             /// <summary>

              /// This is the callback method to handle the

             /// result from the server.

               /// </summary>

             /// <param name="result">The result from the server</param>

             //$get("ctl00_ContentPlaceHolder1_imgProduct").src = "~/ImageHandler/ImageHandler.ashx?imgName=d6b87aa1-a703-45f6-a888-6d309cd62f22&usrName=alex";
           // window.location.reload(true);
           document.forms[0].submit();
             //alert("Zoomed!");
         }
    </script>
    
    <div onmousedown="mousedown(this, event)" >


        <asp:Image ID="imgProduct" runat="server" Width="736px" Height="480px" 
            ImageUrl="~/dummy.jpg"/>


    </div>
    
    <asp:TextBox ID="hidMouseX" Visible="true" runat="server"></asp:TextBox>
    
    <asp:TextBox ID="hidMouseY" Visible="true" runat="server"></asp:TextBox>

    <%--<asp:TextBox ID="outputText" runat="server" OnTextChanged="hidMouse_TextChanged"></asp:TextBox>--%>
    
</asp:Content>